/**
  * Created by Joshua Conero(O'Uymas) on 2016/12/8 0008.
  * QQ: 957376074
  * E-mail: Brximl@163.com
  * GUI 主界面
  */
package org.yang
import java.io.File
import scala.swing.TabbedPane.Page
import scala.swing._
import scala.swing.event.{ButtonClicked, EditDone}
class home(tab:TabbedPane,helper: Common) {
  val br = "\r\n"
  val sign = "\""
  // 主页
  val mainPage = new FlowPanel{
    val fileChooser = new FileChooser(new File(".")){
      title = "打开文件"
    }
    val file_btn = new Button("打开文件")
    val new_btn = new Button("新建文件")
    contents += new_btn
    contents += file_btn
    listenTo(new_btn,file_btn)
    reactions += {
      case ButtonClicked(`new_btn`) =>
        new HomeNewFile(helper)
      case ButtonClicked(`file_btn`) =>
        val fc = fileChooser.showDialog(this,"确定")
        println(fc)
    }
  }
  val leftMenu = new FlowPanel{
    contents += new Label("crawler")
  }
  tab.pages += new Page("crawler",new SplitPane(Orientation.Vertical,leftMenu,mainPage){
    continuousLayout = true
  })
}
